#include "widget.h"
#include "ui_widget.h"
#include "QPushButton"
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QPushButton* button=new QPushButton(this);
    button->setText("关闭界面");
    button->move(320,250);
    connect(button,&QPushButton::clicked,this,&Widget::close);

    QPushButton* button2=new QPushButton(this);
    button2->setText("进入界面1");
    button2->move(150,250);
    connect(button2,&QPushButton::clicked,this,&Widget::handleClicked);

    connect(this,&Widget::mySignal,this,&Widget::handlemySignal);

}

Widget::~Widget()
{
    delete ui;
}

void Widget::handleClicked()
{
    this->setWindowTitle("界面1");
}


void Widget::on_pushButton_clicked()
{
    emit mySignal("界面2");
}

void Widget::handlemySignal(const QString& text)
{
    this->setWindowTitle(text);
}

void Widget::on_pushButton_2_clicked()
{
    emit mySignal("界面3");
}
